<template>
	<view class="content">
    	<!-- <view class="mp-search-input" @click="search">
					<text>请输入职位、公司名</text>
           <image :src="imgUrl + '/image/icon-search.png'" class="icon-search"></image>
				</view> -->
		<yzbClassification
			ref="yzb"
			:list="types"
			:index="index"
			:selectedColor="color"
			:type1LineHeight="lineheight1"
			:type1Size="size1"
			:type2Size="size2"
			:type3Size="size3"
			:type1Height="heigth1"
			@selectType="select"
		></yzbClassification>
	</view>
</template>

<script>
import yzbClassification from './yzb-classification.vue';
export default {
	components: {
		yzbClassification
	},
	data() {
		return {
			imgUrl: '',
			types: [],
			index: 0,
			color: '#4397FF',
			size1: '15px',
			size2: '16px',
			size3: '13px',
			heigth1: '98rpx',
			// type11: []
		};
	},
	created() {
		// 初始化imgUrl
		if (this.$mConfig && this.$mConfig.imageUrl) {
			this.imgUrl = this.$mConfig.imageUrl;
		}
	},
	onLoad() {
		this.getTypes();
	},
	methods: {
		async getTypes() {
      this.types = await this.$apis.getPostList();
      console.log(this.types,'this.types')
			this.$refs.yzb.init();
		},

		select(n1, n2, n3) {
			console.log('点击传来的值为', n1, n2, n3);
			console.log('点击的值为', this.types[n1].child[n2].child[n3].name);
			this.$mPage.prePage().selectPost = this.types[n1].child[n2].child[n3];
			uni.navigateBack({
				delta:1
			})
		}
	}
};
</script>

<style></style>
